import * as crypto from 'crypto'
//  单例模式

export  class Secret{
    static instance = null;
    constructor(){
        if(!Secret.instance){
            Secret.instance = this;
        }
        return Secret.instance;
    }

    static getInit(){
        if(!Secret.instance){
            Secret.instance = new Secret();
        }
        return Secret.instance
    }
  generateSecretKey(length: number = 32): string {
    return crypto.randomBytes(length).toString('hex');
  }
}